package com.sos.comm 
{

	/**
	 * Event dispatched by the CallSequence just before to start to execute a Call added to the sequence.
	 * Provides the current call to be excuted and the call executed before, if the previous call is
	 * null, the current call is the first in the sequence.
	 *  
	 * @author ultima
	 * 
	 */	
	public class CallSequenceBeforeExecutionEvent extends CallSequenceEvent
	{
		
		// -------------------------------------------------------------------------------
		// CONSTANTS
		// -------------------------------------------------------------------------------
		
		public static const		BEFORE_EXECUTION:String			= "sequence_before_exec";
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _call:Call;
		private var _prevCall:Call;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		public function CallSequenceBeforeExecutionEvent(sequence:CallSequence, execCall:Call, prevCall:Call)
		{
			// Ancestor constructor
			super(BEFORE_EXECUTION, sequence);
			// Initialization
			_call 	  = execCall;
			_prevCall = prevCall;
		}
		
		// -------------------------------------------------------------------------------
		// PROPERTIES
		// -------------------------------------------------------------------------------
		


		public function get call():Call
		{
			return _call;
		}

		public function get previousCall():Call
		{
			return _prevCall;
		}


	}
}